<?php
class Usuarios_Form_IdiomasPar extends Form_Cna {
	protected $idiomas;
		
	public function __construct($options = null) {
		parent::__construct($options);
	}
	
	public function setIdiomas($idiomas) {
		$this->idiomas = $idiomas;
	}
	
	public function init() {
	    $domConfig = Zend_Registry::get('domConfig');
		//Crea el formulario para el registro de usuarios del sistema
		$this->setName ( 'idiomas_par' );
		$this->setMethod("POST");
		$this->setAttrib("autocomplete","on");
		
		$array_manejoidioma = array(1=>"Avanzado",2=>"Intermedio",3=>"Básico");
		$array_elements[] = new Zend_Form_Element_Hidden("codusuario");
		$array_elements[] = new Zend_Form_Element_Hidden("codidiomausuario");

		$element = new Zend_Form_Element_Select('codidioma');
		$element->setLabel( 'Idioma : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($this->idiomas);
        $element->setRequired(true);
        $array_elements[]=$element;
		      
        $element = new Zend_Form_Element_Select('lectura');
		$element->setLabel( 'Lee : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($array_manejoidioma);
        $element->setRequired(true);
        $array_elements[]=$element;
                
        $element = new Zend_Form_Element_Select('escritura');
		$element->setLabel( 'Escribe : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($array_manejoidioma);
        $element->setRequired(true);
        $array_elements[]=$element;

        $element = new Zend_Form_Element_Select('comprension');
		$element->setLabel( 'Habla : ' );
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($array_manejoidioma);
        $element->setRequired(true);
        $array_elements[]=$element;
        
		$submit = new Zend_Form_Element_Submit ( 'btnSubmit' );
		$submit->setValue('Guardar');
		$submit->setLabel("Guardar");
		$submit->setAttrib("class", "iceCmdBtn");
		$submit->setDescription($this->createCommandLink("Cancelar", "usuarios/informacionpar/idiomas", "Cancelar"));
		$array_elements[]=$submit;
		
		$this->addElements ($array_elements);
		
		$this->loadTableDecorators();
	}
	
}